package com.babarus.netmonitor;

import java.util.ArrayList;

import android.app.Activity;
import android.app.Application;
import android.util.Log;
import android.widget.ArrayAdapter;

public class GlobalState extends Application  {
	   private static final String TAG = null;
	   
	   private int gameScore = 0;
	   
	   public ExtendedMessenger obj;
	   
	   private  ArrayList<String> devicesList;
	   
	   public void GlobalState(){
		   this.devicesList  = new ArrayList<String>();
		   Log.e(TAG,"called global state constructor");
	   }
  
	   public ArrayList<String> getDevicesList(){		   
		   return devicesList;
	   }
	   public String getDeviceById(int index){
		   return devicesList.get(index);
	   }
	   
	   public ArrayAdapter<String> getDevicePreparedList(Activity context, int element){
	        ArrayAdapter<String> arrayAdapter =      
	                new ArrayAdapter<String>(context,element, this.devicesList);
	        
	        return arrayAdapter;
		   
	   }
	   
	   public int registerDevice( String device ){
		   if(this.devicesList==null){
			   this.devicesList = new ArrayList<String>();
		   }
		   this.devicesList.add(device);
		   return 1;   
	   }
	   
	   public int removeDevice(int index){
		   this.devicesList.remove(index);
		   return 1;
	   }
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
	   
       public int getGameScore() {
            return gameScore;
       }
  
       public void setGameScore(int gameScore) {
           this.gameScore = gameScore;
       }
  
       public void incrementScore(){
           gameScore++;
       }
}
